/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-15
 * Time:14:32
 */
 abstract class Employee {
   private String name;
    public int basicSalary=2000;
    public abstract int calculateTotalSalary();

}
class Worker extends Employee{
   private int workingAge;
    public int getWorkingAge() {
        return workingAge;
    }

    public void setWorkingAge(int workingAge) {
        this.workingAge = workingAge;
    }

    public int calculateTotalSalary() {
        return basicSalary+workingAge*100;
    }
}
class Waiter extends Employee{
    private int tip;
    Waiter(){

    }

    public int gettip() {
        return tip;
    }

    public void settip(int tip) {
        this.tip = tip;
    }

    public int calculateTotalSalary() {
        return basicSalary+tip;
    }
}
public  class Text{
    public static void main(String[] args) {
        Worker fw=new Worker();
        Waiter fw1=new Waiter();
        fw.setWorkingAge(100);
        fw1.settip(2000);
        System.out.println("工人工资："+fw.calculateTotalSalary()+"\n服务员工资："+fw1.calculateTotalSalary());
    }

}